CRMException: Expected only one default business unit team - dynamics-crm-2011

I've created a plugin to set some custom fields on the businessunit entity when it's created.
I registered the plugin and confirmed the context message is Create.
Now, when I create a new businessunit, I get the exception message "Expected only one default business unit team".
I'm not setting the default team and even went so far as to remove the attribute before I save the entity.

The problem was I was running in the context of Create and calling Update to save but the entity that hadn't been officially created yet.
I removed the Update() function because CRM will save my added attributes when it creates the record.

Related

Cant able to create activity using Claim API

we have custom method in claimapi which will create activity and also add the document in claim. When we trigger that method we are getting below error message.
Error message :java.lang.IllegalArgumentException: Cannot re-add Activity:-505001 since it has already been removed. You must use bundle rollback to undo a remove.
Not sure what is causing the issue.
In ClaimAPI method. Ensure you already have a current bundle. If it’s not available, then create a new bundle and create a new Activity.eti record and add it in the new bundle , then provide all mandatory column information. You should be able to do it.

Azure Logic Apps: "When a work item is created" trigger fires endlessly even when no item is created

I am automating some behaviors in azure devops using logic apps in Visual studio. One of the flows is to create a work item when a different work item type is created. The issue is that the flow trigger fires endlessly while only one work item is created
I have tried the following:
* Delete the app and redeploy it
* Delete the resource group and all its contents, create a new project and redeploy it
The full flow criteria
The flow runs more than it should
Update 1:
I did notice that the app triggers endlessly but only for the work items created after its deployment. So, it ignores all previously created work items
Have you tried with a 'Condition' after 'When a work item is created 2', perhaps the trigger condition on the field Type does not work as expected on that datatype? I worked on a case where the 'sql get-rows' where would either return everything or nothing because the connector only supported a specific type of DateTime.
So a condition that would check for the value of Type to be "Test Sales" before moving on to the initialize variable.

Error on Acumatica Create Code File for New DAC based on database table

CreatingCodeFileForNewDACFromDatabaseTable
I am trying to add a new DAC from an existing database table per the Acumatica documentation. However, when I click OK, I get an error:
localhost says "An unhandled exception has occurred in function MoveNext. Please see the trace log for more details.
Anyone seen this before? How should I proceed? Where are the trace logs stored?
Thanks,
David
The issue only happens if there is no ItemDocument table in your database.
If you've just created ItemDocument table, make sure to restart IIS or recycle app pool to make sure Acumatica is aware of the new table, as it caches database schema once, when domain starts.
When you create new DAC in the Customization Manager, its namespace will match name of the customization project:
It's necessary to type FullName of a custom DAC (inc. namespace) when using a custom DAC inside different namespace - DocCenter.ItemBaseDocumen‌​t in your case:
[PXSelector(typeof(S‌​earch<DocCenter.ItemBaseDocumen‌​t.baseDocumentCode,
OrderBy<Asc<DocCenter.ItemBase‌​Document.BaseDocument‌​Code>>>),
DescriptionField = typeof(DocCenter.ItemBaseDocum‌​ent.baseDocumentShort‌​Description))]

NSFetchedResultController not getting updated

I am using a UICollectionView to manage a to-do list with a NSFetchedResultController and RestKit. When I am creating/updating an element with the postObject:/putObject: methods, NSFetchedResultController does not get updated. If I call the reload method on the collection view new objects are not present. The only solution I found is reloading all the objects with getObjectsAtPath.
New objects are well added to the backend storage as well as in the local SQLite database. I set up the NSFetchedResultController's delegate correctly and initialized it with the mainQueueManagedObjectContext.

How to get the parent Account entity for a Sales Order in a Dynamics CRM plugin?

I'm working on a Microsoft Dynamics CRM 2011 plugin attached to SalesOrder entity on Create event. I need to get the Order parent Account, to access some of its properties. I'm trying the following code inside the Execute method, but key "accountid" is not present at time of execution.
Entity entity = (Entity)context.InputParameters["Target"]; // A salesorder entity
EntityReference accountRef = (EntityReference)entity.Attributes["accountid"];
Plugin is registered at Post-operation stage to execute in synchronous mode. Following image show all configuration.
Is there another way to get the parent Account for the SalesOrder entity?
It seem to be an error on the SDK documentation, because the accountid attribute is never available for the salesorder entity, even if I configure the plugin to run in Asynchronous mode. I ended changing the accountid attribute by customerid, which in fact can be an account (default behavior). That solved my problem and I could get a reference to the Account which Order belongs.
Entity entity = (Entity)context.InputParameters["Target"]; // A salesorder entity
EntityReference accountRef = (EntityReference)entity.Attributes["customerid"];
if (accountRef.LogicalName != "account") return;
There are two possible issues here. First, is your plugin registered in Synchronous execution mode with Pre-Operation eventing pipeline stage of execution?
Check out this settings, problem is probably there.
Second, if you correctly registered plugin, maybe you didn't set ParentAccount on SalesOrder form, which is probably not an issue :)

Resources