SAP Business One DI API at item creation should inherit some fields from item group - sapb1

In SAP Business One client, imagine you want to add a new item. You set code, name and group. When you set the group SAP proposes to inherit some fields from such item group. You can choose yes or no.
If you do the same thing with DI API, of course there isn't such a proposal. DI API give for granted that you don't want to inherit fields from the item group.
Is there a way to tell DI API to inherit fields from the item group? Or are we obliged to copy them one by one in our program?

As far as i know this method for maintaining item information from the item group is not exposed to the sdk.
I know that the general ledger information can be maintained using
.GLMethod = SAPbobsCOM.BoGLMethods.glm_ItemClass
but for the other 10(ish) fields you will have to manually set them in your code.
.PlanningSystem = BoPlanningSystem.bop_MRP
.ProcurementMethod = BoProcurementMethod.bom_Make
.OrderIntervals = "Week"
.OrderMultiple = 5
.MinOrderQuantity = 3
.LeadTime = 20
.ToleranceDays = 3
.CostAccountingMethod = BoInventorySystem.bis_Standard

Related

How to change or remove target of object relationship in spring data neo4j?

In spring data neo4j I have simple one-to-many relationship: (:User)-[:EMPLOYEE_OF]->(:Company). User can be employee of only one company. Here are my entities:
class User(#Relationship(type = "EMPLOYEE_OF") var company: Company? = null, /* ids etc */)
class Company(/* ids etc */)
When I want to change target of that relationship or remove it neo4j keeps adding new relationships instead of replacing it.
val user = userRepository.findByName("user1")
val company = companyRepository.findByName("company1")
user.company = company
userRepository.save(user)
// 2nd case
user.company = null
userRepository.save(user)
In both cases, relationships are only added, never removed.
Is there a proper way to do it?
You have to put the load / find and the save in a transaction. The best way in a Spring project to do this is to extract the logic into a service layer method of your application and mark it as #Transactional.
Within this transaction, Spring Data Neo4j / Neo4j-OGM can track the changes that happen on the node and change or remove the relationships.

SQL, Link to Element Feature

I have two classes. One Attribut of class1 is connected to another attribut of class2. This was done with the help of the context menue of the connector in the proximity of one class, it is called Link to element feature. The same is done on the other side of the connector to select the other attribut of the other class. So the connector directly connects two attributes and not the classes itselves. I havenĀ“t found the tables, where this infomation is stored, so I dont find the appropiate SQL to find connected (or not connected) attributes.
Here's the way for notes using Link to..
PDATA1 = 'Attribute'
PDATA2 = t_attribute.ID of the attribute
PDATA3 = name of the attribute
PDATA4 has 'Yes' (I don't recall what that's used for so you can probably ignore it
First SQL:
SELECT PDATA2 FROM t_object WHERE Object_Type='Note' AND PDATA1 = 'Attribute'
will give you the ID. Just put that in another SQL:
SELECT * FROM t_attribute WHERE ID = (above SQL)
and you have the attribute details. Or if you want to find the unmapped one just build a dissection with the found IDs from the first with the existing attribute IDs.
For associations using Link to... it's a bit more tricky. First off, any such connectors have the relevant information stored in t_connector.StyleEx like e.g.
LFEP={69A30E17-23AB-4641-9573-9BDBAA988D52}L;
LF<dir>P=<guid><pos>; connector is attached to attribute/operation
<dir> = S or E meaning Start (source) or End (target) <guid> = ea_guid of t_attribute or t_operation
<pos> is the edge (L or R) where the connector had been attached to in the moment when the link has been created. This is a superfluous information since the renderer will attach the link to whatever place is relevant.
There can be one LFSP, one LFEP or both be present in one StyleEx property
(from my Inside book)
Now you can filter that information with a SQL or (what I prefer) with a little script, since doing complex SQL string operations are not my expertise.

How to Fetch custom column value from Sharepoint 2010 user group

I have created an user group in SP 2010 and i have added one custom column to it, from the list settings.
How to get the custom column value in web part?
EDIT:
My custom column is District. I want to return that column value in visual web part application.
To return group users i use this code
List<SPUser> users = SPContext.Current.Web.SiteGroups["PDO Owners"].Users.ToList();
I assume you mean you created a custom property for the user profile as in my opinion you cannot add extra columns to user groups. You can get the values through the ProfileManager object doing something like this:
//GET THE USER PROFILE MANAGER
SPServiceContext sc = SPServiceContext.GetContext(site);
UserProfileManager userProfileManager = new UserProfileManager(sc);
//GET A PROFILE FOR A USER
UserProfile profile = userProfileManager.GetUserProfile("i:0#.f|fbamembershipprovider|myfbauser");
string propertyvalue = profile["propertyinternalname"].Value.ToString();
Depending on the type of field, you will have to use something else than ToString (eg for a managed metadata field i think you should use TaxonomyFieldValue, etc...)

Setting fields to readonly in dynamics crm 2013 business process flows

I have a business process flow that a customer wants to use cosmetically. All the stages are only on one entity. The customer wants certain look up fields to be read-only. What I've discovered is that while I can disable fields in the active stage of the business process flow using Xrm.Page, users can access other stages and enter data however they like. I haven't been able to find a supported method of making lookup fields readonly in non-active stages. Does anyone know how to do this?
Please try put the following code in the OnLoad event of the Form:
// Get the field in BPF
var c = Xrm.Page.getControl("header_process_<your field name>");
if (c != null) {
c.setDisabled(true);
}
Hope it helps!

Siebel - How to get all accounts of an employee with eScript?

how can I get all accounts of am employee?
In the "Siebel Object Interaces Reference" I found an example, how to get all industries of an account:
var myAccountBO = TheApplication().GetBusObject("Account");
var myAccountBC = myAccountBO.GetBusComp("Account");
var myAssocBC = myAccountBC.GetMVGBusComp("Industry");
So I would like to do something like:
var myEmployeeBO = TheApplication().GetBusObject("Employee");
var myEmployeeBC = myAccountBO.GetBusComp("Employee");
var myAssocBC = myAccountBC.GetMVGBusComp("Account");
But I get an error
Semantic Warning around line 23:No such predefined property Account in class BusComp[Employee].MVGFields.
I can see in Tools that there is no Multi Value Link called "Account" in Business Component "Employee", so I can actually understand the error message.
So I wonder how I can get all accounts of an employee.
I found the Business Component "User" which has a Multi Value Link to "Organisation" and another link "User/Account".
Is this what I am looking for?
How can I know? Where is documentation which tells me about the semantics of links? (Is this described in "Siebel data model reference"? I cannot download this document, although I have signed in...) This link could also link a user to the organization it belongs to.
If one of these links IS what I am looking for, what would be the way to go to get the "User" Business Component of a corresponding "Employee" Business Component?
Many questions of a Siebel newb...Thanks for your patience.
Nang. An easy way to approach this (and to learn it) is to figure out how you'd do it in the UI. Then move onto figuring out how to do the same thing in script.
When you say, "get all account of an employee," do you really mean get all accounts where a particular employee is on the account team? In the UI, that would be done by going to: Accounts > All Accounts Across Organizations, and querying for that specific user in the "Account Team" multi-value field.
From that same view, go to Help > About View in the application menu. You'll see in the popup that the view uses the Account business object and the Account business component. A quick examination of the applet you queried on will show you that the "Account Team" field on the applet is really the "Sales Rep" field on the Account business component. Here's how to mimic what we did in the UI, in script:
var boAccount = TheApplication().GetBusObject("Account");
var bcAccount = boAccount.GetBusComp("Account");
bcAccount.SetViewMode(AllView); // like All .. Across Orgs
bcAccount.ClearToQuery();
bcAccount.SetSearchSpec("Sales Rep", "NANG");
bcAccount.ExecuteQuery();
Then you can walk through the list of accounts and do something with each one like this:
// for each account
for (var bIsRowActive = bcAccount.FirstRecord();
bIsRowActive; b = bcAccount.NextRecord())
{
// do something here
}
I hope you're enjoying Siebel.