Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2022 Release Wave 1 PlanDynamics 365 release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.
2022 release wave 1 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I am setting 'statecode' field of entity 'quote' of CRM using script component in ssis as:
quote.Attributes["statecode"] = Row.activated;
quote.Attributes["statecode"] = null;
But I am getting following error when I run the it:
What can be the reason for this. Please help!!
Thanks in advance.
the reason is the error message you are receiving, you can't set that field to null, you need to put one of the valid values
Doe that mean I have to hard code it?
statecode is for most entities just Active and Inactive, so if the record is not Active (as you are setting in the if condition) then is Inactive
I wrote following code but still throws same error:
if(Row.activated == 1)
quote.Attributes["statecode"] = "Active";
else if (Row.activated == 0)
quote.Attributes["statecode"] = "Draft";
statecode is like an optionset, you need to set it as an optionset (so with a numeric value behind), not as a string, and "Draft" is definitely not a valid state. Check the statecode from the metadata (usually Active is 0 and Inactive is 1) and see how you should set it inside the SSIS script you are writing.
In my case the datatype of statecode is 'Status' and not optionset. How do I assign that in SSIS script
I wrote "is like an optionset", I know that statecode has a specific type to itself but doesn't change the fact that there is a numeric value behind. I don't know how to set it inside the SSIS script you are writing, check how can you set an optionset field inside the ssis script, setting statecode will be nearly the same
Business Applications communities