lunes, 9 de julio de 2012
Crear Cliente AX 2012
CustCustomerService CustCustomerService;
CustCustomer CustCustomer;
//CustCustomer_DirParty CustCustomer_DirParty;
CustCustomer_DirParty_DirOrganization dirOrg;
CustCustomer_DirPartyPostalAddressView CustCustomer_DirPartyPostalAddressView;
CustCustomer_DirPartyContactInfoView CustCustomer_DirPartyContactInfoView;
CustCustomer_CustTable CustCustomer_CustTable;
;
////////////////////////////////////////////////////////////////7
CustCustomerService= CustCustomerService::construct();
CustCustomer=new CustCustomer();
CustCustomer_CustTable=new CustCustomer_CustTable();
dirOrg = new CustCustomer_DirParty_DirOrganization();
////////////////////////////////////////////////////////////////////////7
CustCustomer_CustTable.parmAccountNum("0027");
CustCustomer_CustTable.parmCustGroup("Empleados");
CustCustomer_CustTable.parmGsCueCobClaveReferenciada("1234512333");
CustCustomer_CustTable.parmTaxGroup("IVA 16");
//CustCustomer_DirParty=new CustCustomer_DirParty();
// CustCustomer_CustTable.parmAccountNum("prue1");
dirOrg.parmName("MyCustomerName_OrgName");
dirOrg.parmLanguageId("es-mx");
CustCustomer_CustTable.createDirParty().add(dirOrg);
CustCustomer_DirPartyPostalAddressView=dirOrg.createDirPartyPostalAddressView().addNew();
CustCustomer_DirPartyPostalAddressView.parmStreet("De la villa");
CustCustomer_DirPartyPostalAddressView.parmCountryRegionId("Mex");
CustCustomer_DirPartyPostalAddressView.parmRoles("Business");
CustCustomer_DirPartyContactInfoView=dirOrg.createDirPartyContactInfoView().addNew();
CustCustomer_DirPartyContactInfoView.parmLocationName("Telefono");
CustCustomer_DirPartyContactInfoView.parmLocator("000000000");
CustCustomer_DirPartyContactInfoView.parmType(LogisticsElectronicAddressMethodType::Phone);
CustCustomer_DirPartyContactInfoView.parmRoles("Business");
CustCustomer.createCustTable().add(CustCustomer_CustTable);
CustCustomerService.create(CustCustomer);
}
Suscribirse a:
Enviar comentarios (Atom)
Amigo una consulta y este ejemplo es cuando deseo ingresar un cliente como organizacion y cuando lo desea ingresar como persona.
ResponderEliminarEntiendo que hay que cambiar la clase CustCustomer_DirParty_DirOrganization dirOrg;
por la de persona pero aun asi no puedo ingresar los nombres por separado o genero..
Hola que tal amigo intenta con esto
EliminarCustCustomerService CustCustomerService;
CustCustomer CustCustomer;
//CustCustomer_DirParty CustCustomer_DirParty;
CustCustomer_DirParty_DirOrganization dirOrg;
CustCustomer_DirParty_DirPerson dirPers=new CustCustomer_DirParty_DirPerson();
CustCustomer_PersonName CustCustomer_PersonName=new CustCustomer_PersonName();
CustCustomer_DirPartyPostalAddressView CustCustomer_DirPartyPostalAddressView;
CustCustomer_DirPartyContactInfoView CustCustomer_DirPartyContactInfoView;
CustCustomer_CustTable CustCustomer_CustTable;
;
////////////////////////////////////////////////////////////////7
CustCustomerService= CustCustomerService::construct();
CustCustomer=new CustCustomer();
CustCustomer_CustTable=new CustCustomer_CustTable();
dirOrg = new CustCustomer_DirParty_DirOrganization();
// dirPers = new CustCustomer_DirParty_DirPersons();
////////////////////////////////////////////////////////////////////////7
CustCustomer_CustTable.parmAccountNum("Prue3");
CustCustomer_CustTable.parmCustGroup("Empleados");
CustCustomer_CustTable.parmGsCueCobClaveReferenciada("1234512333");
CustCustomer_CustTable.parmTaxGroup("IVA 16");
//CustCustomer_DirParty=new CustCustomer_DirParty();
// CustCustomer_CustTable.parmAccountNum("prue1");
//dirOrg.parmName("MyCustomerName_OrgName");
// dirOrg.parmLanguageId("es-mx");
dirPers.parmName("Omar");
dirPers.parmNameAlias("Omar");
//didirPersrPers.
CustCustomer_PersonName=dirPers.createPersonName().addNew();
CustCustomer_PersonName.parmFirstName("omar");
CustCustomer_PersonName.parmLastName("Salas Almaguer");
CustCustomer_PersonName.parmMiddleName("Alejandro");
CustCustomer_CustTable.createDirParty().add(dirPers);
CustCustomer_DirPartyPostalAddressView=dirPers.createDirPartyPostalAddressView().addNew();
CustCustomer_DirPartyPostalAddressView.parmStreet("De la villa");
CustCustomer_DirPartyPostalAddressView.parmCountryRegionId("Mex");
CustCustomer_DirPartyPostalAddressView.parmRoles("Business");
CustCustomer_DirPartyContactInfoView=dirPers.createDirPartyContactInfoView().addNew();
CustCustomer_DirPartyContactInfoView.parmLocationName("Telefono");
CustCustomer_DirPartyContactInfoView.parmLocator("000000000");
CustCustomer_DirPartyContactInfoView.parmType(LogisticsElectronicAddressMethodType::Phone);
CustCustomer_DirPartyContactInfoView.parmRoles("Business");
CustCustomer.createCustTable().add(CustCustomer_CustTable);
CustCustomerService.create(CustCustomer);
How can i add mutiple addresses to CustCustomer_DirParty_DirPerson
ResponderEliminarQue ondas David te servira este?
ResponderEliminarhttp://dynamicsaxextremo.blogspot.mx/2012/07/leer-un-csv-dynamics-ax-2012-con-ado.html