We have created some iLogic to make virtual components and populate the iProperties of the virtual component at the same time. I was wondering if anyone has or has seen iLogic that we could add that could look at the Excel we are using to populate the iProperties and change the BOM structure of the virtual component? We would like to be able to change some of the virtual components to Purchased instead of Normal.
Solved! Go to Solution.
Solved by Q_Visser. Go to Solution.
Hi @estringer
Once you have the definition the virtual part will behave similar to a regular definition.
And here is a vba sample to set all virtual part iproperties so you will need to filter for specific ones by name.
Please attach your code version if your having trouble implementing.
Hi @A.Acheson ,
I have attached a copy of the code we are using to create the Virtual Components. Based on my limited understanding of iLogic and your referenced resources, it seems like it is for items that have already been created? I was hoping to have a column in the spreadsheet, that we are using to populate our iProperties, indicate whether the Virtual Component should be Normal or Purchased and then possibly have code that could change that for each Virtual Component as it is created.
Hi @estringer
Well once it is created you can change the structure see syntax here. You just need to tab into the componentdefinition the right time to do so is when you set the iproperties.
Syntax
VirtualComponentDefinition.BOMStructure() As BOMStructureEnum
Hi @estringer
You could definitely have another column in your spreadsheet simply stating if the virtual component is purchased and then add another lookup line within your rule. Based on your posted code, I will use "oProp8" as the variable to hold that lookup value and will assume that the value will return either a "Yes" or "No", but feel free to use whatever you like. Then in the section where you are updating the properties for your virtual component, you should just be able to add the following:
If oProp8 = "Yes" Then
virtocc.Definition.BOMStructure = kPurchasedBOMStructure
End If
You could always add the above block within a Try/Catch block, but as long as "oProp8" (or whatever name you assign the variable) exists in the rule, I don't believe this will error out, as if the condition isn't met, it will just skip that part of the code and leave the virtual component with a BOM Structure of "Normal".
It's a pretty simple addition, but I don't believe it needs to be more complicated.
Hope that helps!
Can't find what you're looking for? Ask the community or share your knowledge.